Skip to content

OCPBUGS-82584: Add labelSelector to MachineSet status for scale subresource#2807

Open
RadekManak wants to merge 1 commit intoopenshift:masterfrom
openshift-cloud-team:OCPBUGS-82584
Open

OCPBUGS-82584: Add labelSelector to MachineSet status for scale subresource#2807
RadekManak wants to merge 1 commit intoopenshift:masterfrom
openshift-cloud-team:OCPBUGS-82584

Conversation

@RadekManak
Copy link
Copy Markdown
Contributor

Summary

MachineSet already advertises a scale subresource with labelSelectorPath: .status.labelSelector, but the API/schema does not define that status field.

  • adds status.labelSelector to machine.openshift.io/v1beta1 MachineSetStatus

The paired openshift/machine-api-operator#1490 change populates status.labelSelector from spec.selector during MachineSet status reconciliation so the /scale subresource can expose Scale.status.selector for HPA/KEDA-style consumers.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Apr 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@RadekManak: This pull request references Jira Issue OCPBUGS-82584, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

MachineSet already advertises a scale subresource with labelSelectorPath: .status.labelSelector, but the API/schema does not define that status field.

  • adds status.labelSelector to machine.openshift.io/v1beta1 MachineSetStatus

The paired openshift/machine-api-operator#1490 change populates status.labelSelector from spec.selector during MachineSet status reconciliation so the /scale subresource can expose Scale.status.selector for HPA/KEDA-style consumers.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Apr 16, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 16, 2026

Hello @RadekManak! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 8250aa19-6234-44c5-b05c-a1e2188388b7

📥 Commits

Reviewing files that changed from the base of the PR and between 6cb9185 and 75901b6.

⛔ Files ignored due to path filters (10)
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-Default.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-OKD.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machine/v1beta1/zz_generated.featuregated-crd-manifests/machinesets.machine.openshift.io/AAA_ungated.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machine/v1beta1/zz_generated.featuregated-crd-manifests/machinesets.machine.openshift.io/MachineAPIMigration.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machine/v1beta1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • openapi/openapi.json is excluded by !openapi/**
📒 Files selected for processing (1)
  • machine/v1beta1/types_machineset.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • machine/v1beta1/types_machineset.go

📝 Walkthrough

Walkthrough

An optional LabelSelector field (type string) was added to MachineSetStatus in machine/v1beta1/types_machineset.go (JSON: labelSelector,omitempty, validation: MinLength=0, MaxLength=4096). It represents the serialized label selector for the MachineSet's machines and is exposed via the scale subresource as status.selector. The field remains unset until the controller reconciles spec.selector into status.labelSelector. No other spec or status fields or control-flow logic were changed.

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive PR appears to contain only schema field additions to MachineSetStatus type with no Ginkgo test code modifications identified. Clarify if PR includes any Ginkgo test code changes requiring custom check review for test quality standards.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a labelSelector field to MachineSet status for the scale subresource, matching the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining why the labelSelector field is being added to MachineSetStatus and its purpose for the scale subresource.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed PR contains no Ginkgo test code, only static type definition field additions. No test names introduced or modified.
Microshift Test Compatibility ✅ Passed This pull request is not applicable to the MicroShift Test Compatibility check because it does not add any new Ginkgo e2e tests. The change is purely an API schema modification that adds a LabelSelector field to the MachineSetStatus type in the machine API.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The custom check evaluates SNO compatibility for new Ginkgo e2e tests. This PR only adds an optional LabelSelector field to MachineSetStatus type with no new test code, making the check not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds only a LabelSelector field to MachineSetStatus struct with no scheduling constraints, pod affinity rules, or controller logic.
Ote Binary Stdout Contract ✅ Passed This PR modifies only an API type definition file adding a field to MachineSetStatus struct. The OTE Binary Stdout Contract applies to test binaries and executable code, not pure type definitions.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds a LabelSelector field to MachineSetStatus type, not Ginkgo e2e tests, so the check does not apply.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented
The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 16, 2026
@openshift-ci openshift-ci bot requested review from everettraven and mandre April 16, 2026 10:18
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign everettraven for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@RadekManak
Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@RadekManak: This pull request references Jira Issue OCPBUGS-82584, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

// It is exposed via the scale subresource as status.selector.
// When omitted, the MachineSet controller has not yet reconciled spec.selector into status.labelSelector.
// +optional
LabelSelector string `json:"labelSelector,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reasonable upper bounds we can set here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The labelSelector for MachineSet is typically the machineset name and cluster name. Additionally, user could add their own. There is no limit on how many they can add on the spec. Set this to 4096 as reasonable high number that won't cause issue to existing clusters.

@RadekManak RadekManak force-pushed the OCPBUGS-82584 branch 2 times, most recently from 62d795b to 6cb9185 Compare April 16, 2026 15:10
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 16, 2026

@RadekManak: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/verify-hypershift-integration 75901b6 link true /test verify-hypershift-integration
ci/prow/lint 75901b6 link true /test lint

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants